package customer9_1_2_7;

public class Customer {
	private int ID;
	private String name;
	private int discount;

	public Customer(int iD, String name, int discount) {
		super();
		ID = iD;
		this.name = name;
		this.discount = discount;
	}

	public int getID() {
		return ID;
	}

	public void setID(int iD) {
		ID = iD;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getDiscount() {
		return discount;
	}

	public void setDiscount(int discount) {
		this.discount = discount;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return Integer.hashCode(ID) + name.hashCode() + Integer.hashCode(discount);
	}

	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		if (!(obj instanceof Customer))
			return false;
		Customer customer = (Customer) obj;
		return this.ID == customer.ID && this.name == customer.name && this.discount == customer.discount;
	}

	@Override
	public String toString() {
		return name + "(" + ID + ")";
	}

}
